﻿using GameFramework.Event;
using System;
using UnityEngine;

namespace GFTest
{
    public sealed class UITouchEventArgs : GameEventArgs
    {
        /// <summary>
        /// UI Touch预告
        /// </summary>
        public static readonly int EventId = typeof(UITouchEventArgs).GetHashCode();

        /// <summary>
        /// UI Touch预告.事件Id
        /// </summary>
        public override int Id
        {
            get
            {
                return EventId;
            }
        }

        public bool IsPress { get; private set; }
        public bool IsMouse { get; private set; }
        public bool IsTouch { get; private set; }
        public int Button { get; private set; }
        public int Finger { get; private set; }
        public GameObject PressedObject{ get; private set; }
        public NGUIForm PressedForm { get; private set; }

        public override void Clear()
		{
            IsMouse = false;
            IsTouch = false;
            Button = 0;
            Finger = 0;
        }

		public UITouchEventArgs Fill(bool isPress, bool isMouse, int index, GameObject pressedObject, NGUIForm pressedForm)
		{
            IsPress = isPress;
            IsMouse = isMouse;
            IsTouch = !isMouse;
            Button = index;
            Finger = index;
            PressedObject = pressedObject;
            PressedForm = pressedForm;
			return this;
		}
	}
}
